<!DOCTYPE html>
<html ng-app="myapp" ng-controller="firstCtrl">
<head>
	<title></title>
	<script type="text/javascript" src="lib/ionic/js/ionic.bundle.js"></script>
	<link rel="stylesheet" type="text/css" href="lib/ionic/css/ionic.css">
	<script src="js/test.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/detail.js"></script>
</head>
<body>
<ion-nav-bar class="bar-positive" align-title="centre"></ion-nav-bar>
<ion-nav-view></ion-nav-view>
</body>
<script type="text/javascript">
// for some git change
	/**
	*  Module
	*
	* Description
	*/
	angular.module('myapp', ['ionic','myapp.detailCtrl']).config(['$stateProvider', function ($stateProvider) {
		$stateProvider.state('welcome',{
			url:'/welcome',
			// url当中的那条‘/’千万不能忘了
			templateUrl:'template/welcome.html',
			controller:'welcome'
		})
		.state('detail',{
			url:'/detail',
			templateUrl:"template/detail.html",
			controller:'detailcontroller'
		})
		.state('detail.detail1',{
			url:'/defalut',
			views:{
				'tab-test':{
					templateUrl:'template/tabdetail1.html',
					controller:'detailcontroller'
				}
			}
		})//共用页面,所以要继承状态
		//detail.detail1,指的是detail1这个状态，是用了detail这个状态，也就是继承了这个状态，之后的views指的是在detail里使用的是哪一个ion-nav-view
		.state('detail.detail2',{
			url:'/defalut2',
			views:{
				'tab-test':{
					templateUrl:'template/tabdetail2.html',
					controller:'detailcontroller'
				}
			}
		})
		.state('detail.capital',{
			url:'/capital',
			views:{
				'capital':{
					templateUrl:'template/capital.html',
					controller:'detailcontroller'
				}
			}
		})
		.state('detail.setting',{
			url:'/setting',
			views:{
				'setting':{
					templateUrl:'template/setting.html',
					controller:'detailcontroller'
				}
			}
		})
		;
	}]).controller('firstCtrl', ['$scope','$state', function($scope,$state){
		$state.go("welcome");
	}]).controller('welcome', ['$scope', function($scope){
		$scope.show=function () {
			console.log("ok");
		}
	}])
	//controller都要拿出去单独写，然后modual也要单独分出去成为app.js
</script>
</html>
